package com.fc.SpringBoot.event;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;
//事件监听器，实现ApplicationListener 泛型：
@Component
public class DemoListener implements ApplicationListener<DemoEvent> {

	@Override
	public void onApplicationEvent(DemoEvent event) {
		String msg = event.getMsg();
		System.out.println("demoListener已收到demoPublisher发布的消息："+msg);
	}

	

}
